<template>
  <div>
    <!--  分割线-->
    <el-divider></el-divider>
    <!--垂直分割-->
    <span style="font-weight:bold"><span style="color:royalblue">|</span>&nbsp;基本资料</span>
    <!--  分割线-->
    <el-divider></el-divider>
    <!--     基本资料 -->
    <el-form :label-position="labelPosition" label-width="80px" :model="firstUpdate">
      <el-row>
        <el-col :span="12">
          <el-form-item label="姓名:">
            <el-input v-model="firstUpdate.empName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="出生日期:">
            <el-input v-model="firstUpdate.empBirthdate"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="性别:">
            <el-radio-group v-model="firstUpdate.empSex">
              <el-radio label="M">男</el-radio>
              <el-radio label="F">女</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="是否在职:">
            <el-radio-group v-model="firstUpdate.empWorkstatus">
              <el-radio label="Y">在职</el-radio>
              <el-radio label="N">不在职</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="证件类型:">
            <el-input v-model="firstUpdate.empPaperstype"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="证件号:">
            <el-input v-model="firstUpdate.empPapersnum"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="最高学历:">
            <el-input v-model="firstUpdate.empHigthEducation"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最高学位:">
            <el-input v-model="firstUpdate.empHigthDegree"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="所内身份:">
            <el-input v-model="firstUpdate.empPosition"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="民族:">
            <el-input v-model="firstUpdate.hrNationId"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="政治面貌:">
            <el-input v-model="firstUpdate.hrPoliticalId"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="婚姻情况:">
            <el-input v-model="firstUpdate.empMaritalsta"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="门禁号:">
            <el-input v-model="firstUpdate.empEntrancenum"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="专业部:">
            <el-input v-model="firstUpdate.hrSpecialtyId"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!--垂直分割-->
    <span style="font-weight:bold"><span style="color:royalblue">|</span>&nbsp;从业资料</span>
    <!--  分割线-->
    <el-divider></el-divider>
    <!--      从业资料-->
    <el-form :label-position="labelPosition" label-width="80px" :model="firstUpdate">
      <el-row>
        <el-col :span="12">
          <el-form-item label="执业类别:">
            <el-input v-model="firstUpdate.hrPractiseId"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="执业证号码:">
            <el-input v-model="firstUpdate.empPracnum"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="首次执业时间:">
            <el-date-picker type="date" placeholder="选择首次执业时间" v-model="firstUpdate.empPracdate"
                            style="width: 100%;"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="首次执业地:">
            <el-input v-model="firstUpdate.empPracsite"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="资格证类别:">
            <el-input v-model="firstUpdate.hrCertifyId"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="资格证号码:">
            <el-input v-model="firstUpdate.empCertifynum"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="资格证取得方式:">
            <el-input v-model="firstUpdate.empGainway"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="资格证取得地:">
            <el-input v-model="firstUpdate.empGainsite"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="个人介绍:">
            <el-input v-model="firstUpdate.empIntroduce"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!--垂直分割-->
    <span style="font-weight:bold"><span style="color:royalblue">|</span>&nbsp;入职情况</span>
    <!--  分割线-->
    <el-divider></el-divider>
    <!--     入职情况 -->
    <el-form :label-position="labelPosition" label-width="80px" :model="firstUpdate">
      <el-row>
        <el-col :span="12">
          <el-form-item label="入职时间:">
            <el-date-picker type="date" placeholder="选择入职时间" v-model="firstUpdate.empEntrydate"
                            style="width: 100%;"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="社保号码:">
            <el-input v-model="firstUpdate.empSocialNum"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="合同开始时间:">
            <el-date-picker type="date" placeholder="选择合同开始时间" v-model="firstUpdate.empContStartdate"
                            style="width: 100%;"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="合同截止时间:">
            <el-date-picker type="date" placeholder="选择合同截止时间" v-model="firstUpdate.empContEnddate"
                            style="width: 100%;"></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="是否参保:">
            <el-radio-group v-model="firstUpdate.empInsured">
              <el-radio label="是">是</el-radio>
              <el-radio label="否">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!--垂直分割-->
    <span style="font-weight:bold"><span style="color:royalblue">|</span>&nbsp;联系信息</span>
    <!--  分割线-->
    <el-divider></el-divider>
    <!--联系信息-->
    <el-form :label-position="labelPosition" label-width="80px" :model="firstUpdate">
      <el-row>
        <el-col :span="12">
          <el-form-item label="手机号码:">
            <el-input v-model="firstUpdate.empPhone"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="照片:">
            <el-input v-model="firstUpdate.empPicture"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="联系电话:">
            <el-input v-model="firstUpdate.empContactPhone"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="联系地址:">
            <el-input v-model="firstUpdate.empSite"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="邮箱:">
            <el-input v-model="firstUpdate.empEmail"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="邮政编码:">
            <el-input v-model="firstUpdate.empPostcode"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="QQ号:">
            <el-input v-model="firstUpdate.empQq"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="微信号:">
            <el-input v-model="firstUpdate.empWechat"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div class="addBut">
      <el-button type="primary" plain @click="updateHrEmp">提交</el-button>
      <el-button type="primary" plain @click="goBack">返回</el-button>
    </div>
  </div>
</template>
<script>
export default {
  name: "HrEmpUpdate.vue",
  data() {
    return {
      id: this.$route.params.id,
      labelPosition: 'top',
      firstUpdate: {},
    };
  },
  created() {
    this.getHrEmp();
  },
  methods: {
    //查询
    getHrEmp() {
      this.$http
          .get("hrEmp",
              {params: {id: this.id,"chaxun":"1"}})
          .then((res) => {
            this.firstUpdate = res.data.data.list[0];
          })
          .catch(function (error) {
            console.log(error);
          });
    },
    //修改
    updateHrEmp() {
      this.$http.put('hrEmp', this.firstUpdate)
          .then(
              this.$notify({
                message: '修改成功!',
                type: 'success'
              }),
              this.$router.push({name:"HrEmp"})
          )
          .catch(function (error) {
            console.log(error);
          });
    },
    goBack() {
      this.$router.push({name:"HrEmp"})
    },
  }
}
</script>

<style scoped>
.addBut {
  text-align: center;
}
</style>